home *** CD-ROM | disk | FTP | other *** search
/ Programming a Multiplayer FPS in DirectX / Programming a Multiplayer FPS in DirectX (Companion CD).iso / DirectX / dxsdk_oct2004.exe / dxsdk.exe / Samples / C++ / DirectInput / DIConfig / flexcheckbox.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-09-27  |  1.5 KB  |  56 lines

  1. //-----------------------------------------------------------------------------
  2. // File: flexcheckbox.h
  3. //
  4. // Desc: Implements a check box control similar to Windows check box.
  5. //       CFlexCheckBox is derived from CFlexWnd.  The only place that
  6. //       uses CFlxCheckBox is in the keyboard for sorting by assigned
  7. //       keys.
  8. //
  9. // Copyright (C) Microsoft Corporation. All Rights Reserved.
  10. //-----------------------------------------------------------------------------
  11.  
  12. #ifndef __FLEXCHECKBOX_H__
  13. #define __FLEXCHECKBOX_H__
  14.  
  15. enum CHECKNOTIFY {
  16.     CHKNOTIFY_UNCHECK,
  17.     CHKNOTIFY_CHECK,
  18.     CHKNOTIFY_MOUSEOVER};
  19.  
  20. class CFlexCheckBox : public CFlexWnd
  21. {
  22.     LPTSTR m_tszText;  // Text string of the message
  23.     BOOL m_bChecked;
  24.     COLORREF m_rgbText, m_rgbBk, m_rgbSelText, m_rgbSelBk, m_rgbFill, m_rgbLine;
  25.     HFONT m_hFont;
  26.  
  27.     HWND m_hWndNotify;
  28.  
  29.     void SetRect();
  30.     void InternalPaint(HDC hDC);
  31.  
  32.     RECT GetRect(const RECT &);
  33.     RECT GetRect();
  34.  
  35.     void Notify(int code);
  36.  
  37. public:
  38.     CFlexCheckBox();
  39.     virtual ~CFlexCheckBox();
  40.  
  41.     void SetNotify(HWND hWnd) { m_hWndNotify = hWnd; }
  42.     void SetCheck(BOOL bChecked) { m_bChecked = bChecked; }
  43.     BOOL GetCheck() { return m_bChecked; }
  44.     void SetText(LPCTSTR tszText);
  45.  
  46.     // cosmetics
  47.     void SetFont(HFONT hFont);
  48.     void SetColors(COLORREF text, COLORREF bk, COLORREF seltext, COLORREF selbk, COLORREF fill, COLORREF line);
  49.  
  50.     virtual void OnPaint(HDC hDC);
  51.     virtual void OnClick(POINT point, WPARAM fwKeys, BOOL bLeft);
  52.     virtual void OnMouseOver(POINT point, WPARAM fwKeys);
  53. };
  54.  
  55. #endif
  56.